Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p><a id="myAnchor" target="_blank" href="http://www.example.com/test.htm#part2">Example link</a></p> <p>Click the button to change the anchor part of the link above.</p> <p><b>Tip:</b> Open the link and look in the address bar before and after you have clicked the "Try it" button, to see the effect.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myAnchor").hash = "newhashvalue"; document.getElementById("demo").innerHTML = "The anchor part was changed from '#part2' to '#newhashvalue'"; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_anchor_hash2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:30:47 GMT --> </html>
Result:
Try it Yourself - © w3schools.com